package com.atguigu.gulimall.order.service;

import com.atguigu.common.to.mq.SecKillOrderTo;
import com.atguigu.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author yuqun
 * @email 1339487892@qq.com
 * @date 2020-05-12 23:03:51
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);
    /**
     * 获取订单确认页需要的数据
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;
    /**
     * 下单
     * @param orderSubmitVo
     * @return
     */
    SubmitOrderRespVo submitOrder(OrderSubmitVo orderSubmitVo);
    /**
     * 根据订单号查询订单状信息
     * @param orderSn
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * 延时关单功能
     * @param entity
     */
    void closeOrder(OrderEntity entity);

    /**
     *
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);
    /*
     * 查询所有的订单和订单项
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 修改订单状态  处理支付宝交易结果
     * @param payAsyncVo
     */
    void handlerPayResult(PayAsyncVo payAsyncVo);

    void createSeckillOrder(SecKillOrderTo seckillOrder);
}

